 #!/usr/bin/python
# -*- coding: utf-8 -*-
#Author: Onur ASLAN
#Mail : hata.pindir@gmail.com 


from PyQt4 import QtCore
from PyQt4 import QtGui
from Ui_MainWindow import Ui_MainWindow

import getpass

 
def applySettings(self):
	self.animate = QtCore.QPropertyAnimation (self.widget_7, "geometry")
	self.animate.setDuration (800)
	self.animate.setStartValue(QtCore.QRect (104, -5, 561, 245))
	self.animate.setEndValue(QtCore.QRect (104, -250, 561, 245))
	self.animate.start() 
	self.ayar_tamam.setCheckable(True)
	self.ayar_tamam.setChecked(False)   
	ayar_yolu = self.ayar_yol.text()
	yol = open("/home/"+str(getpass.getuser())+"/.pindir_ayar_dizin.txt", "w")
	yol.write(str(ayar_yolu))
	yol.close()   		
	sifre = str(self.comboBox.currentText())
	ayardosyasi = open("/home/"+str(getpass.getuser())+"/.pindir_ayar.txt", "w")
	ayardosyasi.write(sifre)
	ayardosyasi.close()		
	dosyaa = open("/home/"+str(getpass.getuser())+"/.pindir_ayar.txt")
	for satir in dosyaa:
 		a = satir
	dosyaa.readline()

   	if a  == "Türkçe":
		self.comboBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "Türkçe", None, QtGui.QApplication.UnicodeUTF8))
		self.comboBox.setItemText(1, QtGui.QApplication.translate("MainWindow", "English", None, QtGui.QApplication.UnicodeUTF8))   	
	 	ayardosyasi = open("/home/"+str(getpass.getuser())+"/.pindir_ayar.txt", "w")
	 	ayardosyasi.write("Türkçe")
	 	ayardosyasi.close()      		
		self.label.setText(unicode("Video Url:"))
		self.label_2.setText(unicode("Dosya Adı:"))
		self.pushButton_4.setText(unicode("URL Yapıştır"))
		self.pushButton.setText(unicode("Temizle"))
		self.izle.setText(unicode("Videoyu İzle"))
		self.getRootPassUnins.setText(unicode("Tamam"))
       		self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "Video İndir", None, QtGui.QApplication.UnicodeUTF8))
              	self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QtGui.QApplication.translate("MainWindow", "Biçim Dönüştür", None, QtGui.QApplication.UnicodeUTF8))
     		self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), QtGui.QApplication.translate("MainWindow", "Video Listesi", None, QtGui.QApplication.UnicodeUTF8))
              	self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QtGui.QApplication.translate("MainWindow", "Pindir Hakkında", None, QtGui.QApplication.UnicodeUTF8))
     		self.tabWidget.setTabText(self.tabWidget.indexOf(self.raporla), QtGui.QApplication.translate("MainWindow", "Hata Raporla", None, QtGui.QApplication.UnicodeUTF8))             		
		self.label_3.setText(unicode("Dosya Seç:"))
		self.label_4.setText(unicode("Yeni Dosya Adı:"))
		self.pushButton_5.setText(unicode("Temizle"))
		self.label_6.setText(unicode("Ekran Çözünürlüğü"))
		self.pushButton_6.setText(unicode("<"))
		self.pushButton_3.setText(unicode("Duraklat"))
		self.play.setText(unicode("Oynat"))
		self.pushButton_yol.setText(unicode("Bul"))
		self.rapor_you_mail.setText(unicode("E-Posta:"))
		self.label_11.setText(unicode("Hata Raporu"))
		self.pushButton_11.setText(unicode("Raporu Gönder"))
		self.getRootPassOk.setText(unicode("Tamam"))
		self.label_16.setText(unicode("*Geliştiricinin iznine ihtiyacınız var! İzin için: <hata.pindir@gmail.com>"))
		self.label_5.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.1.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
		"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
		"p, li { white-space: pre-wrap; }\n"
		"</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#f4f4f4;\">Pindir, yetenekli bir YouTube video indiricisi ve video dönüştürücüsüdür. </span></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#f4f4f4;\">Ayrıca Pindir, video önizlemesini bulur ve videoları izlemenize olanak sağlar.</span></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600; color:#f4f4f4;\">Geliştirici</span><span style=\" color:#f4f4f4;\">: Onur ASLAN</span></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#f4f4f4;\"> &lt;aslanon&gt;</span></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#f4f4f4;\"> &lt;</span><a href=\"hata.pindir@gmail.com\"><span style=\" text-decoration: underline; color:#f4f4f4;\">hata.pindir@gmail.com</span></a><span style=\" color:#f4f4f4;\">&gt;</span></p>\n"
		"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#f4f4f4;\"></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600; color:#f4f4f4;\">Yararlı Sayfalar:</span></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"http://aslanonur.blogspot.com\"><span style=\" text-decoration: underline; color:#f4f4f4;\">http://aslanonur.blogspot.com</span></a></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"http:/pindir-qt.blogspot.com\"><span style=\" text-decoration: underline; color:#f4f4f4;\">http:/pindir-qt.blogspot.com</span></a></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"http://code.google.com/p/pindir\"><span style=\" text-decoration: underline; color:#f4f4f4;\">http://code.google.com/p/pindir</span></a></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
		self.version.setText(unicode("Pindir: 4.1.0"))
		self.pushButton_2.setText(unicode("Kapat"))
		self.btn_about.setText(unicode("Hakkında"))
		self.label_8.setText(unicode("Adresten İndiriliyor..."))
		self.pushButton_9.setText(unicode("Programdan Çık"))
		self.pushButton_10.setText(unicode("Yeni İşlem"))
		self.label_12.setText(unicode("Video indirme ve biçim dönüştürme işlemleri durdurulamaz, geri alınamaz!"))
		self.pushButton_12.setText(unicode("Geri Dön"))
		self.label_9.setText(unicode("Pindir 4.1.0"))
		self.label_7.setText(unicode("Dizin Seç:"))
		self.ayar_baslik.setText(unicode("Pindir - Tercihler"))
		self.ayar_tamam.setText(unicode("Tamam"))
		self.label_13.setText(unicode("Dil Seç:"))
		self.pushButton_8.setText(unicode("Tercihler"))
		self.actionKapat.setText(unicode("Kapat"))
		self.label_19.setText(unicode("Parola:"))
		self.kilit_ac.setText(unicode("Tamam"))
		self.kilit_durum.setText(unicode("İzin Verilemedi!!"))
		self.pushButton_13.setText(unicode("Sürüm Güncelle"))
		self.label_17.setText(unicode("Sürüm Güncelle"))
		self.label_18.setText(unicode("Yeni Ne Var?"))
		self.indir_kur.setText(unicode("Şimdi İndir"))
		self.pushButton_16.setText(unicode("Hayır, sağol!"))
		self.label_19.setText(unicode("Parola:"))
		self.lineEdit_4.setText(unicode("@gmail.com"))
		self.label_15.setText(unicode("Parola:"))
		self.pindirkaldir2.setText(unicode("Şimdi Kaldır"))
		self.label_8.setText(unicode("Video İndiriliyor..."))			
		self.indir_kur_durum.setText(unicode("Arşiv İndirildi Kuruluma Geçebilirsiniz!"))
		self.indir_kur_2.setText(unicode("Şimdi Kur"))  
		self.pindirkaldirvazgec.setText(unicode("Vazgeç"))
		self.pindirkaldir.setText(unicode("Pindir'i Kaldır"))	
		self._ac2.setText(unicode("Geliştirici"))
		
	if a  == "English":
		self.comboBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "English", None, QtGui.QApplication.UnicodeUTF8))
		self.comboBox.setItemText(1, QtGui.QApplication.translate("MainWindow", "Türkçe", None, QtGui.QApplication.UnicodeUTF8))  	
	 	ayardosyasi = open("/home/"+str(getpass.getuser())+"/.pindir_ayar.txt", "w")
	 	ayardosyasi.write("English")
	 	ayardosyasi.close()  
	 	self.getRootPassUnins.setText(unicode("Okay"))
	 	self.pindirkaldirvazgec.setText(unicode("Back"))
	 	self.pindirkaldir2.setText(unicode("Uninistall Now"))
	 	self.pindirkaldir.setText(unicode("Uninstall Pindir"))   		
		self.label.setText(unicode("Video Url:"))
		self.label_2.setText(unicode("File Name:"))
		self.pushButton_4.setText(unicode("Paste URL"))
		self.pushButton.setText(unicode("Clear"))
		self.izle.setText(unicode("Watch the Video"))
		self.pushButton_yol.setText(unicode("Find"))
		self._ac2.setText("Developer")
		self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "Download Video", None, QtGui.QApplication.UnicodeUTF8))
		self.label_3.setText(unicode("Choose File:"))
		self.getRootPassOk.setText(unicode("Okay"))
		self.label_4.setText(unicode("New File Name:"))
		self.pushButton_5.setText(unicode("Clear"))
		self.label_6.setText(unicode("Screen Resolution"))
		self.pushButton_6.setText(unicode("<"))
		self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QtGui.QApplication.translate("MainWindow", "Convert Video", None, QtGui.QApplication.UnicodeUTF8))
		self.all_send_trash.setToolTip(unicode("All Move to Trash"))
		self.all_send_trash.setStatusTip(unicode("All Move to Trash"))
		self.pushButton_3.setText(unicode("Pause"))
		self.play.setText(unicode("Play"))
		self.send_trash.setToolTip(unicode("Move toself.indir_kur Trash"))
		self.send_trash.setStatusTip(unicode("Move to Trash"))
		self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), QtGui.QApplication.translate("MainWindow", "Downloads List", None, QtGui.QApplication.UnicodeUTF8))
		self.rapor_you_mail.setText(unicode("Your Mail:"))
		self.label_11.setText(unicode("Error Report"))
		self.pushButton_11.setText(unicode("Send to Rapor"))
		self.label_16.setText(unicode("*Need permission to Developer! For Permission <hata.pindir@gmail.com>"))
		self.tabWidget.setTabText(self.tabWidget.indexOf(self.raporla), QtGui.QApplication.translate("MainWindow", "Error Report", None, QtGui.QApplication.UnicodeUTF8))
		self.label_5.setText(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.1.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
		"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
		"p, li { white-space: pre-wrap; }\n"
		"</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#f0f0f0;\">Pindir is Youtube video downloader and video converter a talented. </span></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#f0f0f0;\">Also Pindir, the preview image to finding and allows to watch you videos.</span></p>\n"
		"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#f0f0f0;\"></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600; color:#f0f0f0;\">Developer</span><span style=\" color:#f0f0f0;\">: Onur ASLAN</span></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#f0f0f0;\"> &lt;aslanon&gt;</span></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#f0f0f0;\"> &lt;</span><a href=\"hata.pindir@gmail.com\"><span style=\" text-decoration: underline; color:#f0f0f0;\">hata.pindir@gmail.com</span></a><span style=\" color:#f0f0f0;\">&gt;</span></p>\n"
		"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#f0f0f0;\"></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600; color:#f0f0f0;\">Project Pages:</span></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"http://aslanonur.blogspot.com\"><span style=\" text-decoration: underline; color:#f0f0f0;\">http://aslanonur.blogspot.com</span></a></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"http:/pindir-qt.blogspot.com\"><span style=\" text-decoration: underline; color:#f0f0f0;\">http:/pindir-qt.blogspot.com</span></a></p>\n"
		"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"http://code.google.com/p/pindir\"><span style=\" text-decoration: underline; color:#f0f0f0;\">http://code.google.com/p/pindir</span></a></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
		self.version.setText(unicode("Pindir: 4.1.0"))
		self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QtGui.QApplication.translate("MainWindow", "About Pindir", None, QtGui.QApplication.UnicodeUTF8))
		self.pushButton_2.setText(unicode("Close"))
		self.btn_about.setText(unicode("About"))
		self.pushButton_9.setText(unicode("Exit the Program"))
		self.pushButton_10.setText(unicode("New Process"))
		self.label_12.setText(unicode("Video download and format conversion operations cannot be stopped, can not be undone!"))
		self.pushButton_12.setText(unicode("Back"))
		self.label_9.setText(unicode("Pindir 4.1.0"))
		self.label_7.setText(unicode("Select Directory:"))
		self.ayar_baslik.setText(unicode("Pindir - Preferences"))
		self.ayar_tamam.setText(unicode("Okay"))
		self.comboBox.setItemText(0, unicode("Türkçe"))
		self.comboBox.setItemText(1, unicode("English"))
		self.label_13.setText(unicode("Select Language:"))
		self.pushButton_8.setText(unicode("Preferences"))	
		self.label_19.setText(unicode("Password:"))
		self.kilit_ac.setText(unicode("Okay"))
		self.kilit_durum.setText(unicode("Permission denied!"))
		self.pushButton_13.setText(unicode("Version Update"))
		self.label_17.setText(unicode("Version Update"))
		self.label_18.setText(unicode("What\'s New?"))
		self.indir_kur.setText(unicode("Download"))
		self.pushButton_16.setText(unicode("No, Thanks!"))
		self.lineEdit_4.setText(unicode("@gmail.com"))
		self.label_19.setText(unicode("Password:"))
		self.label_15.setText(unicode("Password:")) 	
		self.label_8.setText(unicode("Video Downloading..."))
   		self.indir_kur_durum.setText(unicode("Download completed. How do you?"))
		self.indir_kur_2.setText(unicode("İnstall Now"))
